
import React, {Fragment} from "react";
import {Alert, Form, Input} from "antd";
import Store from "./Store";

class HintMessage extends React.Component{
    constructor(props) {
        super(props);
        this.state = {}
    }

    handleChange = (field,value) => {
        Store.hintMessage[field] = value;
    };

    render() {
        const { TextArea } = Input;
        return (
            <Fragment>
                <Alert closable showIcon type={"info"} message={"小提示"}
                       style={{width: 750,marginBottom:"10px", color: '#31708f !important'}}
                       description={"配置用户操作表单时，页面上的一些提示信息，不填写将使用默认的提示信息"}
                />
                <Form>
                    <Form.Item label={"新建表单提示"}>
                        <TextArea onChange={(e) => {this.handleChange("create_hint",e.target.value)}} defaultValue={Store.hintMessage["create_hint"]} allowClear={true} placeholder={"输入新建表单提示信息"}  rows={4}/>
                    </Form.Item>

                    <Form.Item label={"编辑表单提示"}>
                        <TextArea onChange={(e) => {this.handleChange("update_hint",e.target.value)}} defaultValue={Store.hintMessage["update_hint"]} allowClear={true} placeholder={"输入编辑表单提示信息"}  rows={4}/>
                    </Form.Item>

                    <Form.Item label={"导入提示"}>
                        <TextArea onChange={(e) => {this.handleChange("import_hint",e.target.value)}} defaultValue={Store.hintMessage["import_hint"]} allowClear={true} placeholder={"输入导入提示提示信息"}  rows={4}/>
                    </Form.Item>

                    <Form.Item label={"导出提示"}>
                        <TextArea onChange={(e) => {this.handleChange("export_hint",e.target.value)}} defaultValue={Store.hintMessage["export_hint"]} allowClear={true} placeholder={"输入导出提示提示信息"}  rows={4}/>
                    </Form.Item>
                </Form>
            </Fragment>
        );
    }
}

export default HintMessage;
